var mongoose =require('mongoose');
var Schema = mongoose.Schema;
/**
 * 活动
 * @type {Schema}
 */
var ActivitySchema = new Schema({
    name: {type: String}, //名称
    actType: {type: String, default: 'fanju'}, //活动类型
    startTime: {type: Date, default:Date.now}, //开始时间
    createTime: {type: Date, default:Date.now},
    location: {type: String}, //地点
    remark: {type: String}, //说明
    joinCode: {type: String}, // 加入暗号
    creator: {type: Schema.Types.Mixed}, //发起人
    attendNum: {type: Number, default: 1}, //参加人数
    attends: [{type: Schema.Types.Mixed, ref: 'User'}], //参与人列表

    belongFaction: {type: Schema.Types.ObjectId, ref: 'Faction'},// 隶属圈子
    score: {type: Number, default: 0}, // 积分
    hasContact: {type: Boolean, default:false},
    hasBusiness:{type: Boolean, default:false},
    hasExpired: {type: Boolean, default:false}// 已经过期
})

mongoose.model('Activity', ActivitySchema);